const express = require("express");
const cors = require("cors");
// 定义的子路由引出到服务器文件
const byd_han = require("./router/byd_han");
const byd_index = require("./router/byd_index");
const byd_qin = require("./router/byd_qin");
const byd_song = require("./router/byd_song");
const byd_tang = require("./router/byd_tang");
const byd_yuan = require("./router/byd_yuan");
const pay=require('./router/pay')
const byd_login = require("./router/byd_login");
const byd_register=require("./router/byd_register")
const car_goods = require("./router/car_goods");
const car_users = require("./router/car_users");
const car_neirong = require("./router/car_neirong");
const car_usercontent = require("./router/car_usercontent");
const car_login=require("./router/car_login");

// 创建服务器
const app = express();
// 运行服务器
app.listen(9000, function () {
  console.log("服务器启动成功！");
});
// 设置跨域
app.use(cors());
// 解析参数中间件
app.use(express.json());
// 设置路由中间件
app.use("/index", byd_index);
app.use("/han", byd_han);
app.use("/yuan", byd_yuan);
app.use("/song", byd_song);
app.use("/qin", byd_qin);
app.use("/tang", byd_tang);
app.use('/pay',pay)
app.use("/login", byd_login);
app.use("/register",byd_register)
app.use("/goods", car_goods);
app.use("/users", car_users);
app.use("/neirong", car_neirong);
app.use("/content", car_usercontent);
app.use("/carlogin",car_login)
